{include file="header.html"}
<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView-x">选择参保方案</div>
</div>

<div class="cart-casy main-top">
	<div class="view">
		<div class="title ge-bottom">社保</div>
		<div class="select-view">
			<select id="casy_id">
			{foreach from=$data.casy item=g}
			<option value="{$g->id}" money="{$g->money}">{$g->name}</option>
			{/foreach}
			</select>
		</div>
		<div class="input-view">
			<div class="btn btn-x">最低基数</div>
			<span id="casy_money">0.00</span>
		</div>

		<div class="ge-top"></div>
		<div class="title ge-bottom">公积金</div>
		<div class="text-view">
			<div class="text"><span>公司</span>{$data.row->firm}%</div>
			<div class="text"><span>个人</span>{$data.row->person}%</div>
		</div>
		<div class="input-view gjj">
			<div class="btn {if $data.gjj_price==0}btn-x{/if}">最低基数</div>
			<input type="tel" id="gjj" value="{if $data.gjj_price>0}{$data.gjj_price}{else}{$data.row->money}{/if}" min="{floor($data.row->money)}" max="{floor($data.row->max_money)}" placeholder="范围值：{floor($data.row->money)}~{floor($data.row->max_money)}" />
		</div>
	</div>

	<div class="buttonView">
		<a href="wap.php?app=cart&act=casy_detail">查看消费明细</a>
		<a href="javascript:void(0)" class="btn">确认并提交</a>
	</div>
</div>

{include file="footer.html"}
<script>
$(function(){
	bodyView.find('#casy_money').val(bodyView.find('#casy_id').selected().attr('money'));
	bodyView.find('#casy_id').change(function(){
		bodyView.find('#casy_money').html($(this).selected().attr('money'));
	});
	{if $data.gjj_price==0}
	bodyView.find('.gjj .btn').click(function(){
		var _this = $(this), gjj = bodyView.find('#gjj');
		if(_this.hasClass('btn-x')){
			_this.removeClass('btn-x');
			gjj.val('');
		}else{
			_this.addClass('btn-x');
			gjj.val(gjj.attr('min'));
		}
	});
	{/if}
	bodyView.find('.buttonView .btn').click(function(){
		$('#casy').val(bodyView.find('#casy_id').selected().val());
	});
	pushBodyView({ link:'.buttonView a:eq(0)', click:function(){
		var casy_id = bodyView.find('#casy_id').selected().val();
		this.attr('href', this.attr('href').replace('&casy_id='+casy_id, '')+'&casy_id='+casy_id);
	} }, function(bodyView){
		bodyView.find('.buttonView a').click(function(){
			popBodyView();
		});
	});
});
</script>